#include <stdio.h>

void max_min(int a[], int n, int *max, int *min){
		*max = a[0];
		*min = a[0];
		for (int i = 0; i < n; ++i){
			if (a[i] < *min)
					*min = a[i];
			if (a[i] > *max)
					*max = a[i];
	}
}


int main(){
	const int b[] = {0, 2, 56, 6, -2, 5};
	int n = 6;
	int max, min;
	max_min(b, n, &max, &min);
	printf("Max: %d, min: %d\n", max, min);
}
